package me.cat.learn1.test1;

public class StringDemo11 {
    public static void main(String[] args) {
        String id = "411402200007100051";
        String year = id.substring(6, 10);
        String month = id.substring(10, 12);
        String day = id.substring(12, 14);
        char gender = id.charAt(16);
        int number = gender - 48;
        System.out.println("人物信息为：");
        System.out.println("出生年月日为：" + year + "年" + month + "月" + day + "日");
        if (number % 2 == 0) {
            System.out.println("性别为：女");
        } else {
            System.out.println("性别为：男");
        }
    }
}
